import { defineConfig,splitVendorChunkPlugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import pxtovw from 'postcss-px-to-viewport-8-plugin'
import path from 'path'
const loder_pxtovw = pxtovw({
  viewportWidth: 375,
  viewportHeight: 667,
  viewportUnit: 'vw'
})
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),splitVendorChunkPlugin()],
  css: {
    postcss: {
      plugins: [loder_pxtovw]
    }
  },
  server: {
    host: '0.0.0.0',//自定义主机名
    port: 3000,//自定义端口
    // 是否开启 https
    https: false,
  },
  resolve:{
    alias:{
      "@": path.resolve(__dirname, './src'),
    }
  }
})
